package com.lottemall.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * 异常的枚举
 */
@Getter //只提供get方法
@NoArgsConstructor
@AllArgsConstructor
public enum ExceptionEnume {
    //这是枚举定义常量的简写形式：且必须定义在枚举类的最前面

    CATEGORY_NOT_FOND(404, "商品分类不存在！"),
    SPEC_GROUP_NOT_FOND(404, "商品规格组不存在！"),
    SPEC_PARAM_NOT_FOND(404, "商品规格参数不存在！"),
    BRAND_NOT_FOUND(404, "品牌不存在！"),
    GOODS_NOT_FOUND(404, "商品不存在！"),
    GOODS_SKU_NOT_FOUND(404, "商品SKU不存在！"),
    GOODS_DETAIL_NOT_FOUND(404, "商品详情不存在！"),
    GOODS_STOCK_NOT_FOUND(404, "商品库存不存在！"),


    BRAND_SAVE_ERROR(500, "新增品牌失败！"),
    UPLOAD_FILE_ERROR(500, "文件上传失败！"),
    INVALID_FILE_TYPE(400, "无效文件类型！"),
    GOODS_SAVE_ERROR(500, "新增商品失败！"),
    GOODS_UPDATE_ERROR(500, "修改商品失败！"),
    GOODS_ID_CONNOT_BE_NULL(400, "商品id不能为空！"),
    INVALID_USER_DATA_TYPE(400, "用户的数据类型无效!"),
    INVALID_VERIFY_CODE(400, "无效的验证码!"),
    INVALID_USERNAME_PASSWORD(400, "用户名或密码错误!"),
    USERNAME_OR_PASSWORD_ERROR(400, "账号或密码错误"),
    UNAUTHORIZED(403, "未授权"),
    CART_NOT_FOUND(404, "购物车为空"),
    CREATE_ORDER_ERROR(500, "创建订单失败"),
    STOCK_NOT_ENOUGH(500, "库存不足"),
    ORDER_NOT_FOUND(404, "订单不存在"),
    ORDER_DETAIL_NOT_FOUND(404, "订单详情不存在"),
    ORDER_STATUS_NOT_FOUND(404, "订单状态不存在"),
    WX_PAY_ORDER_FALL(500,"微信下单失败"),
    ORDER_STATUS_ERROR(400,"订单状态异常"),
    WX_PAY_SIGN_INVALID(400,"微信支付签名无效"),
    WX_PAY_NOTIFY_SERVICE_ERROR(400,"微信支付通信或业务标识异常"),
    INVALID_ORDER_PARAM(400,"订单参数异常"),
    UPDATE_ORDER_STATUS_ERROR(500,"更新订单状态失败"),

    ;
    //上面定义常量的参数，这个顺序不能错乱
    private int code;
    private String msg;
}
